<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="Label.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>Label.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'Label.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="draw2d/Label.html">draw2d.Label</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* This notice must be untouched at all times.

FreeGroup Draw2D 0.9.26
The latest version is available at
http://www.freegroup.de

Copyright (c) 2006 Andreas Herz. All rights reserved.
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
or see http://www.gnu.org/copyleft/lesser.html
*/</span>

<span class="comment">/**
 * <span class="attrib">@version</span> 0.9.26
 * <span class="attrib">@author</span> Andreas Herz
 * <span class="attrib">@param</span> {String} msg The text of the label object
 * <span class="attrib">@constructor</span>
 */</span>
draw2d.Label=<span class="reserved">function</span>(<span class="comment">/*:String*/</span> msg)
{
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.msg = msg;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.bgColor = null;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.color = new  draw2d.Color(0,0,0);
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.fontSize= 10;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.textNode = null;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.align = <span class="literal">"center"</span>;
  draw2d.Figure.call(<span class="reserved">this</span>);
};

draw2d.Label.<span class="reserved">prototype</span> = new draw2d.Figure();
<span class="comment">/** <span class="attrib">@private</span> **/</span>
draw2d.Label.<span class="reserved">prototype</span>.type=<span class="literal">"draw2d.Label"</span>;

<span class="comment">/**
 * <span class="attrib">@private</span>
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.createHTMLElement=<span class="reserved">function</span>()
{
    var item = draw2d.Figure.<span class="reserved">prototype</span>.createHTMLElement.call(<span class="reserved">this</span>);
    <span class="reserved">this</span>.textNode = document.createTextNode(<span class="reserved">this</span>.msg);
    item.appendChild(<span class="reserved">this</span>.textNode);
    item.style.color=<span class="reserved">this</span>.color.getHTMLStyle();
    item.style.fontSize=<span class="reserved">this</span>.fontSize+<span class="literal">"pt"</span>;
    item.style.width=<span class="literal">"auto"</span>;
    item.style.height=<span class="literal">"auto"</span>;
    item.style.paddingLeft=<span class="literal">"3px"</span>;
    item.style.paddingRight=<span class="literal">"3px"</span>;
    item.style.textAlign=<span class="reserved">this</span>.align;
    item.style.MozUserSelect = <span class="literal">"none"</span>;
    <span class="reserved">this</span>.disableTextSelection(item);

    <span class="reserved">if</span>(<span class="reserved">this</span>.bgColor!==null)
      item.style.backgroundColor=<span class="reserved">this</span>.bgColor.getHTMLStyle();
    <span class="reserved">return</span> item;
};

<span class="comment">/**
 * A Label is not resizeable. In this case this method returns always &lt;b&gt;false&lt;/b&gt;.
 * <span class="attrib">@returns</span> Returns always false in the case of a Label.
 * <span class="attrib">@type</span> boolean
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.isResizeable=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> false;
};

draw2d.Label.<span class="reserved">prototype</span>.setWordwrap=<span class="reserved">function</span>(<span class="comment">/*:boolean*/</span> flag)
{
  <span class="reserved">this</span>.html.style.whiteSpace=flag?<span class="literal">"wrap"</span>:<span class="literal">"nowrap"</span>;
};


<span class="comment">/**
 * 
 * <span class="attrib">@param</span> {String} align The new align of the label ["left", "center", "right"]
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setAlign=<span class="reserved">function</span>( <span class="comment">/*:String*/</span> align)
{
  <span class="reserved">this</span>.align = align;
  <span class="reserved">this</span>.html.style.textAlign=align;
};

<span class="comment">/**
 * Set the new background color of the label.
 *
 * <span class="attrib">@param</span> {draw2d.Color} color The new background color.
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setBackgroundColor= <span class="reserved">function</span>(<span class="comment">/*:draw2d.Color*/</span> color)
{
  <span class="reserved">this</span>.bgColor = color;
  <span class="reserved">if</span>(<span class="reserved">this</span>.bgColor!==null)
    <span class="reserved">this</span>.html.style.backgroundColor=<span class="reserved">this</span>.bgColor.getHTMLStyle();
  <span class="reserved">else</span>
    <span class="reserved">this</span>.html.style.backgroundColor=<span class="literal">"transparent"</span>;
};

<span class="comment">/**
 * <span class="attrib">@param</span> {draw2d.Color} color The new font color of the label.
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setColor= <span class="reserved">function</span>(<span class="comment">/*:draw2d.Color*/</span> color)
{
  <span class="reserved">this</span>.color = color;
  <span class="reserved">this</span>.html.style.color = <span class="reserved">this</span>.color.getHTMLStyle();
};

<span class="comment">/**
 * Set the new font size in [pt].
 *
 * <span class="attrib">@param</span> {int} size The new font size in &lt;code&gt;pt&lt;/code&gt;
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setFontSize= <span class="reserved">function</span>(<span class="comment">/*:int*/</span> size)
{
  <span class="reserved">this</span>.fontSize = size;
  <span class="reserved">this</span>.html.style.fontSize = <span class="reserved">this</span>.fontSize+<span class="literal">"pt"</span>;
};

<span class="comment">/**
 * A Label did have "autosize". Do nothing at all.
 *
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setDimension=<span class="reserved">function</span>(<span class="comment">/*:int*/</span> w, <span class="comment">/*:int*/</span> h)
{
};

<span class="comment">/**
 * <span class="attrib">@returns</span> the calculated width of the label
 * <span class="attrib">@type</span> int
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.getWidth=<span class="reserved">function</span>()
{
  <span class="reserved">if</span>(window.getComputedStyle)
    <span class="reserved">return</span> parseInt(getComputedStyle(<span class="reserved">this</span>.html,<span class="literal">''</span>).getPropertyValue(<span class="literal">"width"</span>));
  <span class="reserved">return</span> parseInt(<span class="reserved">this</span>.html.clientWidth);
};

<span class="comment">/**
 * <span class="attrib">@returns</span> the calculated height of the label
 * <span class="attrib">@type</span> int
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.getHeight=<span class="reserved">function</span>()
{
  <span class="reserved">if</span>(window.getComputedStyle)
    <span class="reserved">return</span> parseInt(getComputedStyle(<span class="reserved">this</span>.html,<span class="literal">''</span>).getPropertyValue(<span class="literal">"height"</span>));
  <span class="reserved">return</span> parseInt(<span class="reserved">this</span>.html.clientHeight);
};

<span class="comment">/**
 * Returns the current text of the label.
 *
 * <span class="attrib">@returns</span> the current display text of the label
 * <span class="attrib">@type</span> String
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.getText=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> <span class="reserved">this</span>.msg;
};

<span class="comment">/**
 * <span class="attrib">@param</span> {String} text The new text for the label.
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setText=<span class="reserved">function</span>(<span class="comment">/*:String*/</span> text )
{
  <span class="reserved">this</span>.msg = text;
  <span class="reserved">this</span>.html.removeChild(<span class="reserved">this</span>.textNode);
  <span class="reserved">this</span>.textNode = document.createTextNode(<span class="reserved">this</span>.msg);
  <span class="reserved">this</span>.html.appendChild(<span class="reserved">this</span>.textNode);
};

<span class="comment">/**
 * <span class="attrib">@param</span> {String} text The new HTML formated text for the label.
 **/</span>
draw2d.Label.<span class="reserved">prototype</span>.setStyledText=<span class="reserved">function</span>(<span class="comment">/*:String*/</span> text)
{
  <span class="reserved">this</span>.msg = text;
  <span class="reserved">this</span>.html.removeChild(<span class="reserved">this</span>.textNode);
  <span class="reserved">this</span>.textNode = document.createElement(<span class="literal">"div"</span>);
  <span class="reserved">this</span>.textNode.style.whiteSpace=<span class="literal">"nowrap"</span>;
  <span class="reserved">this</span>.textNode.innerHTML=text;
  <span class="reserved">this</span>.html.appendChild(<span class="reserved">this</span>.textNode);
};
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Nov 14 13:45:39 2011</div>
</body>
</html>
